<!--
 * @Descripttion: 
 * @version: 
 * @Author: ybac
 * @Date: 2022-08-18 15:42:05
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-08-25 20:45:49
-->
<!-- 封装时间选择组件 -->
<template>
  <span style="z-index:999999">
    <span style="color:#1890ff" @click.stop="getData">{{code||'--'}}</span>
    <BatchProductionModal ref="BatchProductionModal"></BatchProductionModal>
    <!-- <van-popup
      v-model="show"
      closeable
      position="bottom"
      lock-scroll
      :style="{ height: '80%' }"
      @click.stop="show=false"
    >
      <div class="pop-cont">
        <div class="pop-title">批次生产记录</div>
        <div class="cont-steps">
          <van-steps
            direction="vertical"
            :active="0"
            style="margin-top: 0.1rem"
          >
            <van-step v-for="(item, i) in dataSource" :key="i">
              <div class="step-title">{{ `${item.taskName?item.taskName+'-':''}` }}{{item.operateType||''}}</div>
              <div class="step-text">
                <div>{{ item.operatorName }}</div>
                <div style="width: 2.6rem">{{ item.operateTime }}</div>
              </div>
              <div>
                <div class="step-text">
                  <div style="word-break: break-word;white-space: pre-line;">班组：{{item.teamGroupName||'--'}}，设备：{{item.deviceName||'--'}}</div>
                </div>
                <div class="step-text">
                  <div style="word-break: break-word;white-space: pre-line;">{{item.summary}}</div>
                </div>
              </div>
            </van-step>
          </van-steps>
        </div>
      </div>
    </van-popup> -->
  </span>
</template>

<script>
import { queryProduceRecord } from '@/api/mobile'
import BatchProductionModal from './BatchProductionModal.vue'
export default {
  props: {
    code: {
      type: String,
      default: "", //批次编号
    },
    id: {
      type: String,
      default: "", //批次id
    },
  },
  components: {BatchProductionModal},
  computed: {},
  data() {
    return {
      show: false,
      dataSource: []
    };
  },
  methods: {
    getData() {
      this.$refs.BatchProductionModal.getData(this.id)
      // this.show = true
      // if (this.dataSource.length > 0 || !this.id) {
      //   return
      // }
      // queryProduceRecord({
      //   batchId: this.id,
      //   pageNo: 1,
      //   pageSize: 999
      // }).then(res => {
      //   if (res.success) {
      //     this.dataSource = res.result.records
      //   } else {
      //     this.$toast(res.message)
      //   }
      // })
    }
  },
};
</script>

<style lang="scss" scoped>
.pop-cont {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  .cont-steps {
    flex: 1;
    overflow-y: scroll;
    padding-right: 24px;
  }
}
.pop-title {
  height: 20px;
  border-bottom: 2px solid #eee;
  text-align: center;
  line-height: 20px;
  font-size: 32px;
  color: #191f25!important;
}
.step-title {
  font-size: 32px;
  font-family: PingFang SC;
  font-weight: 500;
  color: #191f25;
}
.step-text {
  font-size: 28px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #888888;
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  div {
    word-break: break-all;
  }
  div:nth-child(1n) {
    flex: 1;
  }
  div:nth-child(2n) {
    text-align: right;
  }
}
</style>
